<template>
  <el-config-provider :locale="localLanguage">
    <el-scrollbar height="100vh" ref="scroll" class="PorscheNextRegular">
      <router-view></router-view>
    </el-scrollbar>
  </el-config-provider>
</template>

<script setup>
  // import i18n from '@/locales';
  import { useRouter } from 'vue-router';
  import zhCn from 'element-plus/dist/locale/zh-cn.mjs';

  // const locale = i18n.global.locale;

  const localLanguage = computed(() => {
    return zhCn;
    // const isDev = process.env.NODE_ENV === 'development';
    // if (isDev) return i18n.global.messages.value[locale.value];
    // else return i18n.global.messages[locale];
  });

  const scroll = ref(null);
  const router = useRouter();

  watch(
    () => router.currentRoute.value,
    () => {
      scroll.value.setScrollTop(0);
    }
  );
</script>

<style lang="scss">
  body {
    min-width: 1080px;
    overflow-x: scroll;
  }
  #app {
    font-family: "PorscheNextRegular","Arial Narrow",Arial,"Heiti SC","SimHei","sans-serif" !important;
    font-size: $base-font-size-default;
    color: #010205;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
</style>
